﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConditionSelector.aspx.cs" Inherits="VitCode.Web.ConditionSelector" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>條件選擇器</title>
    <style>TABLE { FONT-SIZE: 10pt }
	</style>
	<base target="_self">
	<script language="javascript">
		function OnOK()
		{
		    window.returnValue = document.all("Txt_Condition").value;
			window.close();
		}
		
		function OnCancel()
		{
			window.returnValue="CANCEL";
			window.close();
		}
	</script>
</head>
<body style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px"
		bgColor="buttonface" leftMargin="5" topMargin="5" scroll="no" rightMargin="5" MS_POSITIONING="GridLayout">
    <form id="form1" runat="server">
    <table width="100%" align="center">
				<tr>
					<td>欄位</td>
					<td>運算符</td>
					<td>欄位值</td>
					<td colSpan="2">與前一條件關係</td>
				</tr>
				<tr>
					<td width="25%"><asp:dropdownlist id="Lst_Field" Runat="server" Width="100%"></asp:dropdownlist></td>
					<td width="15%"><asp:dropdownlist id="Lst_Operator" Runat="server" Width="100%" 
                            AutoPostBack="True" onselectedindexchanged="Lst_Operator_SelectedIndexChanged"></asp:dropdownlist></td>
					<td width="30%"><asp:panel id="Panel_ConditionValue" Runat="server">
							<asp:TextBox id="Txt_FieldValue" Runat="server" EnableViewState="False"></asp:TextBox>
						</asp:panel><asp:panel id="Panel_ConditionRange" Runat="server" Visible="False">
<asp:TextBox id="Txt_FieldBeginRange" Width="40%" Runat="server" EnableViewState="False"></asp:TextBox>和 
<asp:TextBox id="Txt_FieldEndRange" Width="40%" Runat="server" EnableViewState="False"></asp:TextBox></asp:panel></td>
					<td width="15%"><asp:dropdownlist id="Lst_JoinOperator" Runat="server"></asp:dropdownlist></td>
					<td width="15%"><asp:button id="Btn_AddCondition" Runat="server" Text="添　　加" 
                            onclick="Btn_AddCondition_Click"></asp:button></td>
				</tr>
			</table>
			<fieldset align="middle"><legend><font style="FONT-SIZE: 10pt">已定義條件列表</font></legend>
				<table width="100%" align="center">
					<tr>
						<td width="80%"><asp:listbox id="Lst_ConditionList" Runat="server" Width="100%" 
                                AutoPostBack="True" Height="120" 
                                onselectedindexchanged="Lst_ConditionList_SelectedIndexChanged"></asp:listbox></td>
						<td vAlign="top" width="20%"><asp:button id="Btn_Modify" Runat="server" 
                                Visible="False" Text="修　　改" Enabled="False" onclick="Btn_Modify_Click"></asp:button>
                            <asp:button id="Btn_DeleteCondition" Runat="server" Text="刪除條件" Enabled="False" 
                                onclick="Btn_DeleteCondition_Click"></asp:button><br>
							<br>
							<asp:button id="Btn_ClearCondition" Runat="server" Text="清空條件" Enabled="False" 
                                onclick="Btn_ClearCondition_Click"></asp:button></td>
					</tr>
				</table>
			</fieldset>
			<hr width="100%">
			<table width="100%" align="center">
				<tr>
					<td><asp:checkbox id="Chk_SaveCondition" Runat="server" Text="保存所選條件" Checked="True"></asp:checkbox></td>
					<td align="right"><asp:button id="Btn_OK" Runat="server" Text="確　　定" 
                            onclick="Btn_OK_Click"></asp:button>&nbsp;&nbsp;&nbsp;&nbsp;
						<asp:button id="Btn_Cancel" Runat="server" Text="取　　消" CausesValidation="False" 
                            onclick="Btn_Cancel_Click"></asp:button></td>
				</tr>
			</table>
			<asp:textbox id="Txt_Condition" style="DISPLAY: none" Runat="server"></asp:textbox>
    </form>
</body>
</html>
